<%@ Page Language="c#" AutoEventWireup="true" Inherits="PHSRAG.Insight21.Agreements.AdvanceFundRequestReview" CodeFile="AdvanceFundRequestReview.aspx.cs"%>
<%@ Import Namespace="PHSRAG.Insight.Agreements.Arra"%>
<%@ Import Namespace="PHSRAG.Utility"%>
<%@ Import Namespace="System.Collections.Generic"%>

<%@ Register TagPrefix="cc2" Namespace="PHSRAG.WebControls" Assembly="PHSRAG.WebControls" %>
<%@ Register TagPrefix="cc1" Namespace="PHSRAG.Insight21.InsightWebControls" Assembly="PHSRAG.Insight21.InsightWebControls" %>

<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc3" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Advance Fund Request Review</title>
    <link href="../Insight21.css" type="text/css" rel="stylesheet" />
    <script type="text/javascript">
    function ValidateSubmissionPI(req)
    {
        if(document.getElementById("<%= rbPI.ClientID %>").checked == false)        
        {
            alert('Please acknowledge your responsibility.');
            return false;    
        }
        
        if (document.getElementById("<%= txtUserNamePI.ClientID %>").value == "")        
        {  
            alert('Please provide the User Name.');
            return false;
        }
        
        if(req == true)
        {
            if (document.getElementById("<%= txtPasswordPI.ClientID %>").value == "")        
            {  
                alert('Please provide the Password.');
                return false;
            }   
        }
    }
    
    function ValidateSubmissionCOS(req)
    {
        if(document.getElementById("<%= rbCOS.ClientID %>").checked == false)        
        {
            alert('Please acknowledge your responsibility.');
            return false;    
        }
        
        if (document.getElementById("<%= txtUserNameCOS.ClientID %>").value == "")        
        {  
            alert('Please provide the User Name.');
            return false;
        }
        
        if(req == true)
        {
            if (document.getElementById("<%= txtPasswordCOS.ClientID %>").value == "")        
            {  
                alert('Please provide the Password.');
                return false;
            }   
        }
    }
    
    function ValidateSubmissionGA(req)
    {   
        if (document.getElementById("<%= txtFundNumber.ClientID %>").value == "")        
        {  
            alert('Please provide the Fund Number.');
            return false;
        }
    
        if (document.getElementById("<%= txtUserNameGA.ClientID %>").value == "")        
        {  
            alert('Please provide the User Name.');
            return false;
        }
        
        if(req == true)
        {
            if (document.getElementById("<%= txtPasswordGA.ClientID %>").value == "")        
            {  
                alert('Please provide the Password.');
                return false;
            }   
        }
    }
    
    function ValidateDenial()
    {   
        if (document.getElementById("<%= txtDenial.ClientID %>").value == "")        
        {  
            alert('Please provide the reason for the denial.');
            return false;
        }
    }
    
    function OnDeclineClick()
    {
        if (confirm("Are you sure you want to decline this request?")==true)
            return true;
        else
            return false;
    }
    </script>
    <style type="text/css">
        .autocomplete_listItem
        {
        	background-color:window;
        	color:WindowText;
        	padding:3px;
        }
        .style9
        {
            width: 19px;
        }
        .style10
        {
            width: 98px;
        }
        .style11
        {
            width: 99px;
        }
        .style12
        {
            width: 264px;
        }
        .style13
        {
            width: 265px;
        }
        .style14
        {
            width: 108px;
        }
        .style20
        {
            width: 26px;
        }
        .style23
        {
            width: 79px;
        }
        .style28
        {
            width: 975px;
        }
        .style29
        {
            width: 15px;
        }
        .style30
        {
            color: #2B3D6A;
            font-weight: bold;
            height: 25px;
            width: 75px;
        }
        .style31
        {
            color: #2B3D6A;
            font-weight: bold;
            width: 108px;
            height: 25px;
        }
        .style35
        {
            color: #2B3D6A;
            font-weight: bold;
            width: 169px;
            height: 25px;
        }
        .style36
        {
            width: 169px;
        }
        .style39
        {
            color: #2B3D6A;
            font-weight: bold;
            width: 97px;
            height: 25px;
        }
        .style40
        {
            width: 97px;
        }
        .style43
        {
            color: #2B3D6A;
            font-weight: bold;
            width: 71px;
            height: 25px;
        }
        .style45
        {
            color: #2B3D6A;
            font-weight: bold;
            width: 146px;
            height: 25px;
        }
        .style46
        {
            width: 146px;
        }
        .style47
        {
            color: #2B3D6A;
            font-weight: bold;
            width: 107px;
            height: 25px;
        }
        .style48
        {
            width: 107px;
        }
        .style50
        {
            width: 186px;
        }
        .style53
        {
            color: #2B3D6A;
            font-weight: bold;
            width: 129px;
            height: 25px;
        }
        .style54
        {
            width: 129px;
        }
        .style55
        {
            width: 71px;
        }
        .style56
        {
            color: #2B3D6A;
            font-weight: bold;
            height: 25px;
            width: 77px;
        }
        .style57
        {
            width: 77px;
        }
        .style58
        {
            color: #2B3D6A;
            font-weight: bold;
            height: 25px;
            width: 106px;
        }
        .style59
        {
            width: 106px;
        }
        .style60
        {
            width: 67px;
        }
        .style61
        {
            color: #2B3D6A;
            font-weight: bold;
            width: 98px;
            height: 25px;
        }
        .style63
        {
            height: 28px;
        }
        .style64
        {
            height: 27px;
        }
        .style65
        {
            height: 21px;
        }
        .style67
        {
            color: #2B3D6A;
            font-weight: bold;
            height: 25px;
            width: 81px;
        }
        .style68
        {
            width: 81px;
        }
        .style69
        {
            width: 75px;
        }
        </style>
</head>
<body>
    <script type="text/javascript">
       
    </script>
    <form id="AdvanceFundRequestForm1" method="post" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="True">
        </asp:ScriptManager>
        <table class="Container">
            <tr>
                <td>
                    <table class="Header">
                        <tr>
                            <td>
                                <cc1:Header ID="header" runat="server" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <cc1:AgreementsSubNavigation ID="agreementsSubNavigation" runat="server" BorderStyle="NotSet" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <cc2:BreadCrumb ID="breadCrumb" runat="server" />
                            </td>
                        </tr>
                    </table>                    
                    <table id="dynamicTable" class="Invisible" cellspacing="2">
                        <tr>
                            <td>
                                <cc2:ActivityIndicator ID="activityIndicator" runat="server" ContainerID="dynamicTable" />
                            </td>
                        </tr>
						<tr>
							<td>							
								<cc2:Annunciator ID="annunciator" runat="server" ContainerID="dynamicTable" />							
							</td>
						</tr>
                    </table>
                    <div id="div1" runat="server">  
                        <div class="FramedContainer Padded Margined">  
                            <table>
                            <tr>
                            <td class="style31">
                                Proposal Number
                            </td>
                            <td class="style45">
                                Status
                            </td>
                            <td class="style47">
                                PI Name
                            </td>
                            <td class="style35">
                                Project Title
                            </td>                            
                            <td class="style61">
                                Department
                            </td>                            
                            <td class="style39">
                                Sponsor Name
                            </td>
                            <td class="style53">
                                Project Start/End
                            </td>
                            <td class="style43">
                                Institution
                            </td>
                            <td class="style56">
                                Chief Code
                            </td>
                            <td class="style58">
                                Research Admin
                            </td>
                            <td class="style30">
                                Dept. Admin
                            </td>
                            <td class="style67">
                                Fund Number    
                            </td>
                            <td>
                            </td>
                            </tr>
                            <tr>
                            <td class="style14" valign="top">                               
                                <asp:Label ID="lblPropNo" runat="server"></asp:Label>
                            </td>
                            <td class="style46" valign="top">                               
                                <asp:Label ID="lblStatusName" runat="server"></asp:Label>
                            </td>
                             <td class="style48" valign="top">                               
                                <asp:Label ID="lblPI" runat="server"></asp:Label>
                            </td>
                             <td class="style36" valign="top">                               
                                <asp:Label ID="lblTitle" runat="server"></asp:Label>
                            </td>
                             <td class="style10" valign="top">                               
                                <asp:Label ID="lblDepartment" runat="server"></asp:Label>
                            </td>
                             <td class="style40" valign="top">                               
                                <asp:Label ID="lblSponsor" runat="server"></asp:Label>
                            </td>
                             <td class="style54" valign="top">                               
                                <asp:Label ID="lblProject" runat="server"></asp:Label>
                            </td>
                             <td class="style55" valign="top">                               
                                <asp:Label ID="lblInstitution" runat="server"></asp:Label>
                            </td>
                             <td class="style57" valign="top">                               
                                <asp:Label ID="lblCOS" runat="server"></asp:Label>
                            </td>
                            <td class="style59" valign="top">                               
                                <asp:Label ID="lblResearch" runat="server"></asp:Label>
                            </td>
                            <td valign="top" class="style69">                               
                                <asp:Label ID="lblDept" runat="server"></asp:Label>
                            </td>
                            <td valign="top" class="style68">
                                <asp:Label ID="lblFundNumber" runat="server"></asp:Label>
                            </td>
                            <td>                               
                                <asp:Label ID="lblStatus" runat="server" Visible="false"></asp:Label>
                            </td>
                            </tr>
                            </table>
                        </div>
                    </div>   
                     <table id="tblGeneral" cellpadding="2" cellspacing="4" width="100%" class="AgreementDetails">
                        <tr class="Title">
                            <td>
                                Comments
                            </td>
                        </tr>
                        <tr>
                            <td>                                
                                <asp:Label ID="lblComments" runat="server"></asp:Label>
                            </td>
                        </tr>
                     </table>
                     <br />
                     <table id="Table1" cellpadding="2" cellspacing="4" width="100%" class="AgreementDetails">
                        <tr class="Title">
                            <td>
                                Attachments
                            </td>
                        </tr>
                         <tr>                            
                            <td>                                
                                <asp:GridView ID="gvDocs" runat="server" AutoGenerateColumns="False" 
                                                BorderColor="Black" BorderStyle="Solid" BorderWidth="1px" 
                                    CssClass="DataGrid" PagerSettings-Visible="False" PageSize="5" 
                                                Width="60%" EmptyDataText="No Attachments available.">
                                                <HeaderStyle CssClass="DataGridHeader" />
                                                <FooterStyle CssClass="DataGridHeader" />
                                                <AlternatingRowStyle CssClass="DataGridAlternatingItem" />
                                                <PagerSettings Visible="False" />
                                                <RowStyle CssClass="DataGridItem" />
                                                <Columns>
                                                    <asp:BoundField DataField="Id" HeaderText="ID" Visible="False" />
                                                    <asp:BoundField DataField="PropNumber" HeaderText="PropNumber" 
                                                        Visible="False" />
                                                    <asp:BoundField DataField="UploadedDate" HeaderText="Uploaded Date" 
                                                        SortExpression="">
                                                        <HeaderStyle HorizontalAlign="Left" VerticalAlign="Middle" />
                                                        <ItemStyle HorizontalAlign="Center" VerticalAlign="Top" Width="100px" />
                                                    </asp:BoundField>
                                                    <asp:BoundField DataField="UploadedBy" HeaderText="Uploaded By" 
                                                        SortExpression="">
                                                        <HeaderStyle HorizontalAlign="Left" VerticalAlign="Middle" />
                                                        <ItemStyle HorizontalAlign="Left" VerticalAlign="Top" Width="140px" />
                                                    </asp:BoundField>                                                
                                                    <asp:BoundField DataField="DocumentName" HeaderText="Document Name" 
                                                        SortExpression="">
                                                        <HeaderStyle HorizontalAlign="Left" VerticalAlign="Middle" />
                                                        <ItemStyle HorizontalAlign="Left" VerticalAlign="Top" />
                                                     </asp:BoundField>   
                                                     <asp:TemplateField HeaderText="Action">
                                                        <ItemTemplate>
                                                            <asp:ImageButton ID="ibView" runat="server" 
                                                                CommandArgument='<%# Bind("FileUrl") %>' CommandName="ViewDoc" 
                                                                ImageUrl="~/Images/b_view.gif" ToolTip='<%# Bind("FileUrl") %>' Visible="true" />
                                                        </ItemTemplate>
                                                        <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                                        <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="70px" />
                                                    </asp:TemplateField>                                                                                               
                                                </Columns>
                                            </asp:GridView>
                            </td>
                        </tr>
                     </table>
                     <br />
                     <table id="Table2" cellpadding="2" cellspacing="4" width="100%" class="AgreementDetails">
                        <tr class="Title">
                            <td>
                                Approvals
                            </td>
                        </tr>
                         <tr>                            
                            <td>                                
                                <asp:GridView ID="gvApprovals" runat="server" AutoGenerateColumns="False" 
                                                BorderColor="Black" BorderStyle="Solid" BorderWidth="1px" 
                                    CssClass="DataGrid" PagerSettings-Visible="False" PageSize="5" 
                                                Width="60%" EmptyDataText="Not yet approved once.">
                                                <HeaderStyle CssClass="DataGridHeader" />
                                                <FooterStyle CssClass="DataGridHeader" />
                                                <AlternatingRowStyle CssClass="DataGridAlternatingItem" />
                                                <PagerSettings Visible="False" />
                                                <RowStyle CssClass="DataGridItem" />
                                                <Columns>                                                    
                                                    <asp:BoundField DataField="Status" HeaderText="Approval Status" >
                                                        <ItemStyle HorizontalAlign="Left" VerticalAlign="Middle" Width="130px" />
                                                    </asp:BoundField>
                                                    <asp:BoundField DataField="ApprovedDate" HeaderText="Approved Date" 
                                                        SortExpression="">
                                                        <HeaderStyle HorizontalAlign="Left" VerticalAlign="Middle" />
                                                        <ItemStyle HorizontalAlign="Left" VerticalAlign="Top" Width="120px" />
                                                    </asp:BoundField>
                                                    <asp:BoundField DataField="ApprovedBy" HeaderText="Approved By" 
                                                        SortExpression="">
                                                        <HeaderStyle HorizontalAlign="Left" VerticalAlign="Middle" />
                                                        <ItemStyle HorizontalAlign="Left" VerticalAlign="Top" />
                                                    </asp:BoundField>                                                            
                                                </Columns>
                                            </asp:GridView>
                            </td>
                        </tr>
                     </table>
                        <asp:Panel ID="Panel3" runat="server" Width="99%" BorderWidth="0">   
                          <div class="FramedContainer Padded Margined">  
                            <table style="height: 30px">
                                <tr>
                                    <td class="style23">                                    
                                        <asp:RadioButton ID="rbApprove" runat="server" Text="Approve" 
                                            AutoPostBack="True" GroupName="Funding" 
                                            oncheckedchanged="rbApprove_CheckedChanged" />                                    
                                    </td> 
                                    <td>                                    
                                        <asp:RadioButton ID="rbDecline" runat="server" Text="Decline" 
                                            AutoPostBack="True" GroupName="Funding" 
                                            oncheckedchanged="rbDecline_CheckedChanged" />                                    
                                    </td>                                   
                                </tr>
                            </table>                                                                        
                            <asp:Panel ID="Panel4" runat="server" Width="99%" BorderWidth="0">                            
                            <table style="width: 98%" border="0">                                
                                <tr>
                                <td colspan="10">                                                              
                                <asp:Label ID="Label8" runat="server" Font-Bold="False"                                     
                                    Text="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Step 1 - Principle Investigator:" 
                                    Height="19px" style="font-size: 11px; font-weight: 700;"></asp:Label>                                
                                
                                </td>
                                </tr>
                                <tr>
                                <td colspan="10" class="style63">                                                                   
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<asp:RadioButton ID="rbPI" 
                                        runat="server" Font-Italic="True" 
                                        Font-Size="X-Small" 
                                        
                                        Text="&nbsp;I understand that the establishment of this fund does not exempt me for the fiduciary responsibility to cover any and all expenses - both direct and indirect - in the event the fund or agreement does not get award." 
                                        style="font-size: 11px" />
                                
                                </td>
                                </tr>  
                                <tr>
                                <td class="style29">
                                    &nbsp;
                                </td>
                                <td class="style60">
                                    &nbsp;User Name:
                                </td>
                                <td class="style50">
                                    <asp:TextBox ID="txtUserNamePI" runat="server" Width="148px"></asp:TextBox>                                
                                </td>
                                <td>
                                    &nbsp;
                                </td>
                                <td>
                                    Password:
                                </td>
                                 <td>
                                     <asp:TextBox ID="txtPasswordPI" runat="server" Width="148px" 
                                         TextMode="Password"></asp:TextBox>
                                </td>
                                <td>
                                    &nbsp;
                                </td>
                                 <td>
                                     Date/Time:
                                </td>
                                 <td>
                                     <asp:TextBox ID="txtDateTimePI" runat="server" Width="148px" Enabled="False"></asp:TextBox>
                                </td>
                                <td align="right" valign="middle">                                
                                    <asp:ImageButton ID="imgBtnSubmitPI" runat="server" 
                                        AlternateText="approve" ImageUrl="~/Images/b_submit.gif" onclick="imgBtnSubmitPI_Click" 
                                         />                                
                                </td>
                                </tr>                             
                            </table>                            
                            </asp:Panel> 
                            <asp:Panel ID="Panel5" runat="server" Width="99%">                            
                            <table style="width: 98%" border="0">                               
                                <tr>
                                <td colspan="10">                                
                                <asp:Label ID="Label9" runat="server" Font-Bold="False"                                     
                                    Text="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Step 2 - Chief of Service:" 
                                    Height="19px" style="font-size: 11px; font-weight: 700;"></asp:Label>                                
                                
                                </td>
                                </tr>
                                <tr>
                                <td colspan="10" class="style63">                                
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<asp:RadioButton ID="rbCOS" 
                                        runat="server" Font-Italic="True" 
                                        Font-Size="X-Small" 
                                        
                                        
                                        Text="&nbsp;I understand that the department is responsible for providing funding in the event that the award is not realized." 
                                        style="font-size: 11px" />
                                
                                </td>
                                </tr>  
                                <tr>
                                <td class="style20">
                                    &nbsp;
                                </td>
                                <td class="style10">
                                    User Name:
                                </td>
                                <td class="style12">
                                    <asp:TextBox ID="txtUserNameCOS" runat="server" Width="148px"></asp:TextBox>                                
                                </td>
                                <td>
                                    &nbsp;
                                </td>
                                <td>
                                    Password:
                                </td>
                                 <td>
                                     <asp:TextBox ID="txtPasswordCOS" runat="server" Width="148px" 
                                         TextMode="Password"></asp:TextBox>
                                </td>
                                <td>
                                    &nbsp;
                                </td>
                                 <td>
                                     Date/Time:
                                </td>
                                 <td>
                                     <asp:TextBox ID="txtDateTimeCOS" runat="server" Width="148px" Enabled="False"></asp:TextBox>
                                </td>
                                <td align="right" valign="middle">
                                
                                    <asp:ImageButton ID="imgBtnSubmitCOS" runat="server" 
                                        AlternateText="approve" ImageUrl="~/Images/b_submit.gif" onclick="imgBtnSubmitCOS_Click" 
                                        />                                
                                </td>
                                </tr>                             
                            </table>                            
                            </asp:Panel>  
                            <asp:Panel ID="Panel6" runat="server" Width="99%">                            
                            <table style="width: 98%">                                
                                <tr>
                                <td colspan="10" class="style64">                                
                                <asp:Label ID="Label10" runat="server" Font-Bold="False"                                     
                                    Text="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Step 3 - Research Management:" 
                                    Height="19px" style="font-size: 11px; font-weight: 700;"></asp:Label>                                
                                
                                </td>
                                </tr>
                                <tr>
                                <td class="style9">
                                    &nbsp;
                                </td>
                                <td class="style65">                                
                                    &nbsp; Enter Fund #:                                
                                </td>
                                <td colspan="8">
                                    <asp:TextBox ID="txtFundNumber" runat="server" Width="148px"></asp:TextBox>
                                </td>
                                </tr>  
                                <tr>
                                <td class="style9">
                                    &nbsp;
                                </td>
                                <td class="style11">
                                    &nbsp; User Name:
                                </td>
                                <td class="style13">
                                    <asp:TextBox ID="txtUserNameGA" runat="server" Width="148px"></asp:TextBox>                                
                                </td>
                                <td>
                                    &nbsp;
                                </td>
                                <td>
                                    Password:<b> </b>
                                </td>
                                 <td>
                                     <asp:TextBox ID="txtPasswordGA" runat="server" Width="148px" 
                                         TextMode="Password"></asp:TextBox>
                                </td>
                                <td>
                                    &nbsp;
                                </td>
                                 <td>
                                     Date/Time:
                                </td>
                                 <td>
                                     <asp:TextBox ID="txtDateTimeGA" runat="server" Width="148px" Enabled="False"></asp:TextBox>
                                </td>
                                <td align="right" valign="middle">
                                
                                    <asp:ImageButton ID="imgBtnSubmitGA" runat="server" 
                                        AlternateText="approve" ImageUrl="~/Images/b_submit.gif" onclick="imgBtnSubmitGA_Click" 
                                        />                                
                                </td>
                                </tr>                             
                            </table>                            
                            </asp:Panel>                            
                            <asp:Panel ID="Panel7" runat="server" Width="99%">                            
                            <table style="width: 98%" cellpadding="0" cellspacing="0">                                                             
                                <tr>
                                <td align="left" valign="top" class="style14">                                
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Reason:                                
                                
                                </td>
                                <td align="left" valign="middle" class="style28">
                                    <asp:TextBox ID="txtDenial" runat="server" Width="87%" 
                                        style="margin-left: 0px" TextMode="MultiLine"></asp:TextBox>
                                </td>
                                <td align="right" valign="middle">
                                
                                    <asp:ImageButton ID="imgBtnDenial" runat="server" AlternateText="approve" 
                                        ImageUrl="~/Images/b_submit.gif" onclick="imgBtnDenial_Click" />
                                
                                </td>
                                </tr>                                               
                            </table>                            
                            </asp:Panel> 
                         </div> 
                      </asp:Panel>   
                </td>
            </tr>
        </table>
    </form>
</body>
</html>
